Optimal. Leaf size=78 \[ -\frac {a^3 \tanh ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a+b}}\right )}{b^{7/2} \sqrt {a+b}}+\frac {\left (a^2-a b+b^2\right ) \sin (x)}{b^3}+\frac {(a-2 b) \sin ^3(x)}{3 b^2}+\frac {\sin ^5(x)}{5 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3265, 398, 214}
\begin {gather*} -\frac {a^3 \tanh ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a+b}}\right )}{b^{7/2} \sqrt {a+b}}+\frac {\left (a^2-a b+b^2\right ) \sin (x)}{b^3}+\frac {(a-2 b) \sin ^3(x)}{3 b^2}+\frac {\sin ^5(x)}{5 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 398
Rule 3265
Rubi steps
\begin {align*} \int \frac {\cos ^7(x)}{a+b \cos ^2(x)} \, dx &=\text {Subst}\left (\int \frac {\left (1-x^2\right )^3}{a+b-b x^2} \, dx,x,\sin (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {a^2-a b+b^2}{b^3}+\frac {(a-2 b) x^2}{b^2}+\frac {x^4}{b}-\frac {a^3}{b^3 \left (a+b-b x^2\right )}\right ) \, dx,x,\sin (x)\right )\\ &=\frac {\left (a^2-a b+b^2\right ) \sin (x)}{b^3}+\frac {(a-2 b) \sin ^3(x)}{3 b^2}+\frac {\sin ^5(x)}{5 b}-\frac {a^3 \text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\sin (x)\right )}{b^3}\\ &=-\frac {a^3 \tanh ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a+b}}\right )}{b^{7/2} \sqrt {a+b}}+\frac {\left (a^2-a b+b^2\right ) \sin (x)}{b^3}+\frac {(a-2 b) \sin ^3(x)}{3 b^2}+\frac {\sin ^5(x)}{5 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.45, size = 111, normalized size = 1.42 \begin {gather*} \frac {a^3 \left (\log \left (\sqrt {a+b}-\sqrt {b} \sin (x)\right )-\log \left (\sqrt {a+b}+\sqrt {b} \sin (x)\right )\right )}{2 b^{7/2} \sqrt {a+b}}+\frac {\left (8 a^2-6 a b+5 b^2\right ) \sin (x)}{8 b^3}+\frac {(-4 a+5 b) \sin (3 x)}{48 b^2}+\frac {\sin (5 x)}{80 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 78, normalized size = 1.00
method | result | size |
default | \(\frac {\frac {\left (\sin ^{5}\left (x \right )\right ) b^{2}}{5}+\frac {a b \left (\sin ^{3}\left (x \right )\right )}{3}-\frac {2 b^{2} \left (\sin ^{3}\left (x \right )\right )}{3}+a^{2} \sin \left (x \right )-a b \sin \left (x \right )+b^{2} \sin \left (x \right )}{b^{3}}-\frac {a^{3} \arctanh \left (\frac {b \sin \left (x \right )}{\sqrt {\left (a +b \right ) b}}\right )}{b^{3} \sqrt {\left (a +b \right ) b}}\) | \(78\) |
risch | \(-\frac {i {\mathrm e}^{i x} a^{2}}{2 b^{3}}+\frac {3 i {\mathrm e}^{i x} a}{8 b^{2}}-\frac {5 i {\mathrm e}^{i x}}{16 b}+\frac {i {\mathrm e}^{-i x} a^{2}}{2 b^{3}}-\frac {3 i {\mathrm e}^{-i x} a}{8 b^{2}}+\frac {5 i {\mathrm e}^{-i x}}{16 b}+\frac {a^{3} \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \left (a +b \right ) {\mathrm e}^{i x}}{\sqrt {a b +b^{2}}}-1\right )}{2 \sqrt {a b +b^{2}}\, b^{3}}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \left (a +b \right ) {\mathrm e}^{i x}}{\sqrt {a b +b^{2}}}-1\right )}{2 \sqrt {a b +b^{2}}\, b^{3}}+\frac {\sin \left (5 x \right )}{80 b}+\frac {5 \sin \left (3 x \right )}{48 b}-\frac {\sin \left (3 x \right ) a}{12 b^{2}}\) | \(194\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 91, normalized size = 1.17 \begin {gather*} \frac {a^{3} \log \left (\frac {b \sin \left (x\right ) - \sqrt {{\left (a + b\right )} b}}{b \sin \left (x\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{2 \, \sqrt {{\left (a + b\right )} b} b^{3}} + \frac {3 \, b^{2} \sin \left (x\right )^{5} + 5 \, {\left (a b - 2 \, b^{2}\right )} \sin \left (x\right )^{3} + 15 \, {\left (a^{2} - a b + b^{2}\right )} \sin \left (x\right )}{15 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 259, normalized size = 3.32 \begin {gather*} \left [\frac {15 \, \sqrt {a b + b^{2}} a^{3} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {a b + b^{2}} \sin \left (x\right ) - a - 2 \, b}{b \cos \left (x\right )^{2} + a}\right ) + 2 \, {\left (3 \, {\left (a b^{3} + b^{4}\right )} \cos \left (x\right )^{4} + 15 \, a^{3} b + 5 \, a^{2} b^{2} - 2 \, a b^{3} + 8 \, b^{4} - {\left (5 \, a^{2} b^{2} + a b^{3} - 4 \, b^{4}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{30 \, {\left (a b^{4} + b^{5}\right )}}, \frac {15 \, \sqrt {-a b - b^{2}} a^{3} \arctan \left (\frac {\sqrt {-a b - b^{2}} \sin \left (x\right )}{a + b}\right ) + {\left (3 \, {\left (a b^{3} + b^{4}\right )} \cos \left (x\right )^{4} + 15 \, a^{3} b + 5 \, a^{2} b^{2} - 2 \, a b^{3} + 8 \, b^{4} - {\left (5 \, a^{2} b^{2} + a b^{3} - 4 \, b^{4}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{15 \, {\left (a b^{4} + b^{5}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 96, normalized size = 1.23 \begin {gather*} \frac {a^{3} \arctan \left (\frac {b \sin \left (x\right )}{\sqrt {-a b - b^{2}}}\right )}{\sqrt {-a b - b^{2}} b^{3}} + \frac {3 \, b^{4} \sin \left (x\right )^{5} + 5 \, a b^{3} \sin \left (x\right )^{3} - 10 \, b^{4} \sin \left (x\right )^{3} + 15 \, a^{2} b^{2} \sin \left (x\right ) - 15 \, a b^{3} \sin \left (x\right ) + 15 \, b^{4} \sin \left (x\right )}{15 \, b^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 86, normalized size = 1.10 \begin {gather*} \frac {{\sin \left (x\right )}^5}{5\,b}+{\sin \left (x\right )}^3\,\left (\frac {a+b}{3\,b^2}-\frac {1}{b}\right )+\sin \left (x\right )\,\left (\frac {3}{b}+\frac {\left (a+b\right )\,\left (\frac {a+b}{b^2}-\frac {3}{b}\right )}{b}\right )+\frac {a^3\,\mathrm {atan}\left (\frac {\sqrt {b}\,\sin \left (x\right )\,1{}\mathrm {i}}{\sqrt {a+b}}\right )\,1{}\mathrm {i}}{b^{7/2}\,\sqrt {a+b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________